<?php
	function change_date_view_to_sql($date)
	{
		 $a=$date; 
		  
		$ngaya = substr("$a", 0, 2);
		$thanga = substr("$a", 3, 2);
		$nama = substr("$a", 6, 4);
		return $date = $nama."-".$thanga."-".$ngaya;
	}
	function change_date_sql_to_view($date)
	{
		$a=$date; 		 
		$ngaya = substr("$a", 8, 2);
		$thanga = substr("$a", 5, 2);
		$nama = substr("$a", 0, 4);
		return $date = $ngaya."-".$thanga."-".$nama;
	}
	function change_date_hourse_sql_to_view($date)
	{
		$a=$date; 		 
		$ngaya = substr("$a", 8, 2);
		$thanga = substr("$a", 5, 2);
		$nama = substr("$a", 0, 4);
		return $date = $ngaya."-".$thanga."-".$nama;
	}
?>